//
//  ContenxtMessageViewController.m
//  OperationPro
//
//  Created by yaxue wang on 16/11/10.
//  Copyright © 2016年 展鸿科技. All rights reserved.
//

#import "ContenxtMessageViewController.h"
#import "ContextMessageTable.h"
#import "DetailsViewController.h"
#import "MessageViewController.h"
@interface ContenxtMessageViewController ()

@end

@implementation ContenxtMessageViewController


- (void)initView
{
    [super initView];
    [self setTitle:@"任务回复"];
    __block typeof(self) blockself = self;
    
    [self.navBar setBackAction:^{
        if([blockself.type isEqualToString:@"推送"]) {
            MessageViewController *messVc=[[MessageViewController alloc]init];
            messVc.type=blockself.type;
            [blockself.navigationController pushViewController:messVc animated:NO];
        }else  {
            [blockself backController];
            
        }
        
    }];
    ContextMessageTable*contextView =[[ContextMessageTable alloc]initWithFrame:CGRectMake(0, 64, WindowWidth, WindowHeight-64)];
    contextView.backgroundColor=[UIColor clearColor];
    [self.view addSubview:contextView];
    
    [contextView setCCellSelect:^(NSMutableDictionary* dic) {
        DetailsViewController *detailVc =[[DetailsViewController alloc]init];
        detailVc.warningUuid= [dic objectForKey:@"warningUuid"];
        detailVc.state=[dic objectForKey:@"state"];
        detailVc.type=2;
        [blockself pushController:detailVc];
    }];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
